/**
 * 
 */
package com.explgo.backend.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.explgo.backend.domain.Plan;
import com.explgo.backend.jpa.PlanRepository;
import com.explgo.backend.service.PlanService;

/**
 * The plan service.
 * 
 * @author Jialiang(Cain) Wang
 * 
 */
@Service
public class PlanServiceImpl implements PlanService {
	@Autowired
	private PlanRepository planDao;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.explgo.backend.service.PlanService#get(long)
	 */
	@Override
	public Plan get(long id) {
		return planDao.findOne(id);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.explgo.backend.service.PlanService#save(com.explgo.backend.domain
	 * .Plan)
	 */
	@Override
	public Plan save(Plan plan) {
		return planDao.save(plan);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.explgo.backend.service.PlanService#delete(int)
	 */
	@Override
	public void delete(long id) {
		planDao.delete(id);
	}

}
